<template>
  <div class="home-container">
    <el-row :gutter="20">
      <el-col :span="16">
        <div class="monitor-section">
          <camera-view />
        </div>
        <div class="data-section">
          <broken-line />
        </div>
      </el-col>
      <el-col :span="8">
        <div class="status-cards">
          <el-card v-for="(item, index) in statusItems" :key="index">
            <template #header>
              <div class="card-header">
                {{ item.title }}
              </div>
            </template>
            <div class="card-content">
              <div class="value">{{ item.value }}</div>
              <div class="unit">{{ item.unit }}</div>
            </div>
          </el-card>
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import CameraView from './camera.vue'
import BrokenLine from './brokenLine.vue'

const statusItems = ref([
  { title: '温度', value: '25.4', unit: '°C' },
  { title: '湿度', value: '65', unit: '%' },
  { title: '光照', value: '15000', unit: 'lux' }
])
</script>

<style scoped>
.home-container {
  padding: 20px;
}

.monitor-section {
  margin-bottom: 20px;
  height: 400px;
  background: #0a2744;
  border-radius: 8px;
}

.data-section {
  height: 300px;
  background: #0a2744;
  border-radius: 8px;
}

.status-cards {
  .el-card {
    margin-bottom: 20px;
    background: #0a2744;
    border: 1px solid #1890ff;
    
    .card-header {
      font-size: 18px;
      color: #fff;
    }
    
    .card-content {
      text-align: center;
      
      .value {
        font-size: 36px;
        color: #1890ff;
      }
      
      .unit {
        font-size: 14px;
        color: #888;
      }
    }
  }
}
</style>